package gui;

import java.awt.Dimension;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JPanel;

public class UserControlPanel extends JPanel {
  private static final long serialVersionUID = -4563608487057327554L;
    
  public UserControlPanel(EarthPanel pnlEarth, Clock clock) {
    super();
    setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
    int pnlHeight = 300;
    setPreferredSize(new Dimension(100,pnlHeight));
    setMaximumSize(new Dimension(630,pnlHeight));
    
    //row 1
    JPanel pnl = getRowPanel();
    pnl.add(new PhysicalControlPanel());
    pnl.add(Box.createHorizontalStrut(10));
    pnl.add(new SimulationControlPanel(pnlEarth, clock));
    pnl.add(Box.createHorizontalStrut(10));
    pnl.add(new InvocationSettingsPanel());
    add(pnl);
    
    //row 2
    pnl = getRowPanel();
    pnl.add(new QueryDateTimePanel());
    pnl.add(Box.createHorizontalStrut(20));
    pnl.add(new QueryRegionPanel());
    add(pnl);
    
    //row 3
    pnl = getRowPanel();
    pnl.add(new QueryOutputSettingsPanel());
    pnl.add(Box.createHorizontalStrut(20));
    pnl.add(new QueryRunPanel(clock));
    add(pnl);
  }
  
  private JPanel getRowPanel() {
    JPanel pnl = new JPanel();
    pnl.setLayout(new BoxLayout(pnl, BoxLayout.LINE_AXIS));
    return pnl;
  }
    
}
